
package org.bridgen.lang.semantics.ast;
import java.util.*;


public class NodeUse extends Use implements Cloneable {
    public void flushCache() {
        super.flushCache();
    }
     @SuppressWarnings({"unchecked", "cast"})  public NodeUse clone() throws CloneNotSupportedException {
        NodeUse node = (NodeUse)super.clone();
        node.in$Circle(false);
        node.is$Final(false);
    return node;
    }
     @SuppressWarnings({"unchecked", "cast"})  public NodeUse copy() {
      try {
          NodeUse node = (NodeUse)clone();
          if(children != null) node.children = (ASTNode[])children.clone();
          return node;
      } catch (CloneNotSupportedException e) {
      }
      System.err.println("Error: Could not clone node of type " + getClass().getName() + "!");
      return null;
    }
     @SuppressWarnings({"unchecked", "cast"})  public NodeUse fullCopy() {
        NodeUse res = (NodeUse)copy();
        for(int i = 0; i < getNumChildNoTransform(); i++) {
          ASTNode node = getChildNoTransform(i);
          if(node != null) node = node.fullCopy();
          res.setChild(node, i);
        }
        return res;
    }
    // Declared in NameAnalysis.jrag at line 21

	
	/**
	 * Checking:
	 * 1) Unknown declaration of node type
	 */
	public void nameAnalysis(Collection errorList) {
		if (decl() == null) {
			error(errorList, "Node type " + getName() + " unknown");
		} 
	}

    // Declared in PrettyPrint.jrag at line 276

    
    public void pp(StringBuffer buf) {
    	buf.append(getName());
    }

    // Declared in bridgit.ast at line 3
    // Declared in bridgit.ast line 115

    public NodeUse() {
        super();


    }

    // Declared in bridgit.ast at line 10


    // Declared in bridgit.ast line 115
    public NodeUse(String p0) {
        setName(p0);
    }

    // Declared in bridgit.ast at line 14


  protected int numChildren() {
    return 0;
  }

    // Declared in bridgit.ast at line 17

  public boolean mayHaveRewrite() { return false; }

    // Declared in bridgit.ast at line 2
    // Declared in bridgit.ast line 115
    protected String tokenString_Name;

    // Declared in bridgit.ast at line 3

    public void setName(String value) {
        tokenString_Name = value;
    }

    // Declared in bridgit.ast at line 6

    public String getName() {
        return tokenString_Name != null ? tokenString_Name : "";
    }

    // Declared in NameAnalysis.jrag at line 222
 @SuppressWarnings({"unchecked", "cast"})     public NodeDecl decl() {
        NodeDecl decl_value = decl_compute();
        return decl_value;
    }

    private NodeDecl decl_compute() {  return lookupNode(getName());  }

    // Declared in TypeCodeGen.jrag at line 553
 @SuppressWarnings({"unchecked", "cast"})     public String callString() {
        String callString_value = callString_compute();
        return callString_value;
    }

    private String callString_compute() {  return getName();  }

    // Declared in NameAnalysis.jrag at line 227
 @SuppressWarnings({"unchecked", "cast"})     public NodeDecl lookupNode(String name) {
        NodeDecl lookupNode_String_value = getParent().Define_NodeDecl_lookupNode(this, null, name);
        return lookupNode_String_value;
    }

public ASTNode rewriteTo() {
    return super.rewriteTo();
}

}
